package com.supersonic.backend.model;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;

@Entity
public class LogisticsTask extends BaseModel{
	private String senderName;
	private String receiverName;
	private String senderContactNumber;
	private String receiverContactNumber;
	
	@ManyToOne(cascade={CascadeType.ALL},fetch=FetchType.LAZY)
	private JobStatus status;
	private float rate;
	
	private String tracking;
	
	private String trackNo;
	
	@ManyToOne(cascade={CascadeType.ALL},fetch=FetchType.LAZY)
	private Logistics logistic;
	
	@ManyToOne(cascade={CascadeType.ALL},fetch=FetchType.LAZY)
	private Net pickupNet;

	@ManyToOne(cascade={CascadeType.ALL},fetch=FetchType.LAZY)
	private Net dispatchNet;
	
	private String latestProgressOverview;

	/**
	 * @return the senderName
	 */
	public String getSenderName() {
		return senderName;
	}

	/**
	 * @param senderName the senderName to set
	 */
	public void setSenderName(String senderName) {
		this.senderName = senderName;
	}

	/**
	 * @return the receiverName
	 */
	public String getReceiverName() {
		return receiverName;
	}

	/**
	 * @param receiverName the receiverName to set
	 */
	public void setReceiverName(String receiverName) {
		this.receiverName = receiverName;
	}

	/**
	 * @return the senderContactNumber
	 */
	public String getSenderContactNumber() {
		return senderContactNumber;
	}

	/**
	 * @param senderContactNumber the senderContactNumber to set
	 */
	public void setSenderContactNumber(String senderContactNumber) {
		this.senderContactNumber = senderContactNumber;
	}

	/**
	 * @return the receiverContactNumber
	 */
	public String getReceiverContactNumber() {
		return receiverContactNumber;
	}

	/**
	 * @param receiverContactNumber the receiverContactNumber to set
	 */
	public void setReceiverContactNumber(String receiverContactNumber) {
		this.receiverContactNumber = receiverContactNumber;
	}

	/**
	 * @return the status
	 */
	public JobStatus getStatus() {
		return status;
	}

	/**
	 * @param status the status to set
	 */
	public void setStatus(JobStatus status) {
		this.status = status;
	}

	/**
	 * @return the rate
	 */
	public float getRate() {
		return rate;
	}

	/**
	 * @param rate the rate to set
	 */
	public void setRate(float rate) {
		this.rate = rate;
	}

	/**
	 * @return the tracking
	 */
	public String getTracking() {
		return tracking;
	}

	/**
	 * @param tracking the tracking to set
	 */
	public void setTracking(String tracking) {
		this.tracking = tracking;
	}

	/**
	 * @return the trackItem
	 */
	public List<TrackItem> getTrackItem() {
		return TrackItem.ConvertStringToTrackItemList(tracking);
	}

	/**
	 * @param trackItemList the trackItem to set
	 */
	public void setTrackItem(List<TrackItem> trackItemList) {
		this.tracking = TrackItem.convertTrackItemListToString(trackItemList);
	}

	/**
	 * @return the trackNo
	 */
	public String getTrackNo() {
		return trackNo;
	}

	/**
	 * @param trackNo the trackNo to set
	 */
	public void setTrackNo(String trackNo) {
		this.trackNo = trackNo;
	}

	/**
	 * @return the logistic
	 */
	public Logistics getLogistic() {
		return logistic;
	}

	/**
	 * @param logistic the logistic to set
	 */
	public void setLogistic(Logistics logistic) {
		this.logistic = logistic;
	}

	/**
	 * @return the pickupNet
	 */
	public Net getPickupNet() {
		return pickupNet;
	}

	/**
	 * @param pickupNet the pickupNet to set
	 */
	public void setPickupNet(Net pickupNet) {
		this.pickupNet = pickupNet;
	}

	/**
	 * @return the dispatchNet
	 */
	public Net getDispatchNet() {
		return dispatchNet;
	}

	/**
	 * @param dispatchNet the dispatchNet to set
	 */
	public void setDispatchNet(Net dispatchNet) {
		this.dispatchNet = dispatchNet;
	}

	/**
	 * @return the latestProgressOverview
	 */
	public String getLatestProgressOverview() {
		return latestProgressOverview;
	}

	/**
	 * @param latestProgressOverview the latestProgressOverview to set
	 */
	public void setLatestProgressOverview(String latestProgressOverview) {
		this.latestProgressOverview = latestProgressOverview;
	}
	

}
